import request from '@/utils/request'
// 登录
export function getlogin(data) {
  return request({
    url: '/login',
    method: 'post',
    data: data,
  })
}
// 上班打卡
export function getworkclock(data) {
  return request({
    url: '/attendance/clockIn',
    method: 'post',
    data: data,
  })
}
// 当天打卡状态
export function getstatus() {
  return request({
    url: '/attendance/getClockInById',
    method: 'get',
  })
}
// 下班打卡
export function downwork(data) {
  return request({
    url: '/attendance/addIn',
    method: 'post',
    data: data,
  })
}
// 退出
export function exit() {
  return request({
    url: '/logout',
    method: 'post',
  })
}
// 个人信息
export function getpersonal() {
  return request({
    url: '/user/info',
    method: 'get',
  })
}
// 考勤记录
export function record() {
  return request({
    url: '/attendance/timeTag',
    method: 'get',
  })
}
// 坐席员值班长/主页统计
export function Statistics() {
  return request({
    url: '/matters/handle/number',
    method: 'get',
  })
}
// （坐席员，值班长）提交
export function Submit(data) {
  return request({
    url: '/matters/seater/submit',
    method: 'post',
    data: data,
  })
}
// 坐席员个人台账
export function selectstatus(data) {
  return request({
    url: '/matters/seater/individual/account',
    method: 'post',
    data: data,
  })
}
// （坐席员，值班长，职能部门）个人台账导出
export function accountExport(data) {
  return request({
    url: '/matters/individual/account/export',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}
// 坐席员事件事项
export function Escalation(data) {
  return request({
    url: '/matters/agent/reports',
    method: 'post',
    data: data,
  })
}
// 修改用户信息
export function changeusermessage(data) {
  return request({
    url: '/user/update',
    method: 'post',
    data: data,
  })
}
// 请假记录
export function leave(current, limit) {
  return request({
    url: '/leave/seaters',
    method: 'get',
    params: {
      current: current,
      limit: limit,
    },
  })
}
// 销假
export function endVacation(leaveId) {
  return request({
    url: '/leave/endVacation',
    method: 'get',
    params: {
      leaveId: leaveId,
    },
  })
}
// 请假申请详情
export function details(id) {
  return request({
    url: '/leave/select',
    method: 'get',
    params: {
      id: id,
    },
  })
}
// 查询所有请假类型
export function type() {
  return request({
    url: '/leaveType/leaveTypeAll',
    method: 'get',
  })
}
// 新增请假申请
export function addapplication(data) {
  return request({
    url: '/leave/save',
    method: 'post',
    data: data,
  })
}
// 坐席代办数量
export function quantity() {
  return request({
    url: '/matters/seater/action/items/count',
    method: 'post',
  })
}
// 坐席员代办
export function agency(data) {
  return request({
    url: '/matters/seater/action/items',
    method: 'post',
    data: data,
  })
}
// 查询所有请假类型
export function getclue(data) {
  return request({
    url: '/matters/matter-clue/get/by-id',
    method: 'get',
    params: data,
  })
}

// 查询通知公告记录
export function getNoticeClue(noticeId) {
  return request({
    url: '/notice/noticeClue',
    method: 'get',
    params: {
      noticeId,
    },
  })
}

export default {
  getlogin,
  getworkclock,
  getstatus,
  downwork,
  exit,
  getpersonal,
  record,
  Statistics,
  Submit,
  selectstatus,
  accountExport,
  Escalation,
  changeusermessage,
  leave,
  details,
  type,
  addapplication,
  quantity,
  getclue,
  endVacation,
  getNoticeClue,
  agency,
}
